package com.esri.core.ogc.wmts;

import com.esri.core.ogc.OwsItem;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.xml.sax.Attributes;

/* loaded from: classes.dex */
public class WMTSTileMatrixSetLink extends OwsItem {
    private String a;
    private WMTSTileMatrixLimits b;
    private Map<String, WMTSTileMatrixLimits> c = new HashMap();

    public String getTileMatrixSetIdentifier() {
        return this.a;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void a(String str) {
        this.a = str;
    }

    public List<String> getTileMatrixIds() {
        return new ArrayList(this.c.keySet());
    }

    public WMTSTileMatrixLimits getTileMatrixLimitsById(String str) {
        return this.c.get(str);
    }

    @Override // com.esri.core.ogc.OwsItem
    public void startElement(String str, Attributes attributes) {
        super.startElement(str, attributes);
        if ("TileMatrixLimits".equals(str)) {
            this.b = new WMTSTileMatrixLimits();
        }
    }

    @Override // com.esri.core.ogc.OwsItem
    public void endElement(String str) {
        WMTSTileMatrixLimits wMTSTileMatrixLimits;
        String currentTagName = getCurrentTagName();
        if ("TileMatrixSet".equals(currentTagName)) {
            a(this.mData.toString());
        } else if ("TileMatrixLimits".equals(str)) {
            WMTSTileMatrixLimits wMTSTileMatrixLimits2 = this.b;
            if (wMTSTileMatrixLimits2 != null) {
                this.c.put(wMTSTileMatrixLimits2.getTileMatrixIdentifier(), this.b);
                this.b = null;
            }
        } else if ("TileMatrix".equals(currentTagName)) {
            WMTSTileMatrixLimits wMTSTileMatrixLimits3 = this.b;
            if (wMTSTileMatrixLimits3 != null) {
                wMTSTileMatrixLimits3.a(this.mData.toString());
            }
        } else if ("MinTileRow".equals(currentTagName)) {
            WMTSTileMatrixLimits wMTSTileMatrixLimits4 = this.b;
            if (wMTSTileMatrixLimits4 != null) {
                wMTSTileMatrixLimits4.a(Integer.parseInt(this.mData.toString()));
            }
        } else if ("MaxTileRow".equals(currentTagName)) {
            WMTSTileMatrixLimits wMTSTileMatrixLimits5 = this.b;
            if (wMTSTileMatrixLimits5 != null) {
                wMTSTileMatrixLimits5.b(Integer.parseInt(this.mData.toString()));
            }
        } else if ("MinTileCol".equals(currentTagName)) {
            WMTSTileMatrixLimits wMTSTileMatrixLimits6 = this.b;
            if (wMTSTileMatrixLimits6 != null) {
                wMTSTileMatrixLimits6.c(Integer.parseInt(this.mData.toString()));
            }
        } else if ("MaxTileCol".equals(currentTagName) && (wMTSTileMatrixLimits = this.b) != null) {
            wMTSTileMatrixLimits.d(Integer.parseInt(this.mData.toString()));
        }
        super.endElement(str);
    }
}
